import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      component: () => import("../views/Manage.vue"),
      redirect: "/home",
      children: [
        {
          path: "/user",
          name: "user",
          component: () => import("../views/User.vue")
        },
        {
          path: "/home",
          name: "home",
          component: () => import("../views/Home.vue")
        },
        {
          path: "/person",
          name: "person",
          component: () => import("../views/Person.vue")
        },
        {
          path: "/foodSafety",
          name: "foodSafety",
          component: () => import("../views/foodSafety.vue")
        },
        {
          path: "/foodSupervise",
          name: "foodSupervise",
          component: () => import("../views/foodSupervise.vue")
        },
        {
          path: "/foodSafetyTable",
          name: "foodSafetyTable",
          component: () =>
            import("../views/foodSafetyModule/foodSafetyTable.vue")
        },
        {
          path: "/credit",
          name: "credit",
          component: () => import("../views/credit.vue")
        },
        {
          path: "/creditTable",
          name: "creditTable",
          component: () => import("../views/creditModule/creditTable.vue")
        },
        {
          path: "/administration",
          name: "administration",
          component: () => import("../views/administration.vue")
        },
        {
          path: "/administrationTable",
          name: "administrationTable",
          component: () =>
            import("../views/administrationModule/administrationTable.vue")
        },
        {
          path: "/product",
          name: "product",
          component: () => import("../views/product.vue")
        },
        {
          path: "/productTable",
          name: "productTable",
          component: () => import("../views/productModule/productTable.vue")
        },
        {
          path: "/mobile",
          name: "mobile",
          component: () => import("../views/mobile.vue")
        }
      ]
    },
    {
      path: "/login",
      name: "login",
      component: () => import("../views/Login.vue")
    },
    {
      path: "/register",
      name: "Register",
      component: () => import("../views/Register.vue")
    }
  ],
  mode: "history"
});
